En este documento se nos habla de la calidad del café, además de la misión y la organización de la menera en la cual se evalúa el café en El Coffe Quality Institute (CQI), de USA, para un explicación más clara en esta página se mostraráen forma de gráficos. Tomado de: CQI
library(tidyverse)
library(plotly)
library(DT)
library(readr)
library(ggplot2)
library(gapminder)
library(ggthemes)
library(hrbrthemes)
tabla <- "https://raw.githubusercontent.com/gf0604-procesamientodatosgeograficos/2023-i/main/datos/cqi/coffee-quality.csv"
data <- read.csv(tabla)
datatable(data[, c(
"Country_of_Origin",
"Variety",
"Color",
"Altitude",
"Total_Cup_Points")],
options = list(pageLength = 10, lengthMenu = c(10, 20, 50)),
rownames = FALSE)
histograma <-
ggplot(data, aes(x = Total_Cup_Points)) +
geom_histogram(
aes(
text = paste0(
"Distribución", round(after_stat(x), 2), "\n",
"Frecuencia: ", after_stat(count)
),
y = after_stat(density)
),
bins = 10
) +
geom_density() +
scale_y_continuous(labels = scales::label_comma()) +
labs(x = "Total", y = "Frecuencia",
title = "Distribución de Total") +
theme_gdocs()
ggplotly(histograma, tooltip = "text") |>
config(locale = 'es')
dispersion <-
ggplot(data, aes(x = Altitude, y = Total_Cup_Points)) +
geom_point(aes(
text = paste0(
"País: ", Country_of_Origin, "\n",
"Altitud:", round(Altitude, 2), "\n",
"Puntaje Total:", round(Total_Cup_Points, 2), "\n"
)
)) +
geom_smooth(method = "lm") +
ggtitle("Altitud vs Total Cup Points") +
xlab("Altitud") +
ylab("Puntaje Total") +
theme_gdocs()
ggplotly(dispersion, tooltip = "text") |>
config(locale = 'es')
caja <- ggplot(data, aes(x = Color, y = Total_Cup_Points)) +
geom_boxplot() +
ggtitle("Distribución del Puntaje Total cada color") +
xlab("Color") +
ylab("Puntaje Total") +
theme_gdocs()
ggplotly(caja) |>
config(locale = 'es')